package com.abner.design.patterns.mediator;

/**
 * 窗帘(交给中介者管理的类)
 * @author abner
 */
public class Curtains extends Colleague {

	/**
	 * 对象初始化的时候注册到中介者里面
	 * @param mediator
	 * @param name
	 */
	public Curtains(Mediator mediator, String name) {
		super(mediator, name);
		mediator.register(name, this);
	}

	@Override
	public void sendMessage(int stateChange) {
		this.getMediator().getMessage(stateChange, this.name);
	}

	public void UpCurtains() {
		System.out.println("I am holding Up Curtains!");
	}

}
